package com.tl.app.service.impl;

import java.util.List;
import com.tl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tl.app.mapper.AppOrderPriceConfigMapper;
import com.tl.app.domain.AppOrderPriceConfig;
import com.tl.app.service.IAppOrderPriceConfigService;

/**
 * 订单价格配置Service业务层处理
 * 
 * @author suhp
 * @date 2024-07-28
 */
@Service
public class AppOrderPriceConfigServiceImpl implements IAppOrderPriceConfigService 
{
    @Autowired
    private AppOrderPriceConfigMapper appOrderPriceConfigMapper;

    /**
     * 查询订单价格配置
     * 
     * @param id 订单价格配置主键
     * @return 订单价格配置
     */
    @Override
    public AppOrderPriceConfig selectAppOrderPriceConfigById(Long id)
    {
        return appOrderPriceConfigMapper.selectAppOrderPriceConfigById(id);
    }

    /**
     * 查询订单价格配置列表
     * 
     * @param appOrderPriceConfig 订单价格配置
     * @return 订单价格配置
     */
    @Override
    public List<AppOrderPriceConfig> selectAppOrderPriceConfigList(AppOrderPriceConfig appOrderPriceConfig)
    {
        return appOrderPriceConfigMapper.selectAppOrderPriceConfigList(appOrderPriceConfig);
    }

    /**
     * 新增订单价格配置
     * 
     * @param appOrderPriceConfig 订单价格配置
     * @return 结果
     */
    @Override
    public int insertAppOrderPriceConfig(AppOrderPriceConfig appOrderPriceConfig)
    {
        appOrderPriceConfig.setCreateTime(DateUtils.getNowDate());
        return appOrderPriceConfigMapper.insertAppOrderPriceConfig(appOrderPriceConfig);
    }

    /**
     * 修改订单价格配置
     * 
     * @param appOrderPriceConfig 订单价格配置
     * @return 结果
     */
    @Override
    public int updateAppOrderPriceConfig(AppOrderPriceConfig appOrderPriceConfig)
    {
        appOrderPriceConfig.setUpdateTime(DateUtils.getNowDate());
        return appOrderPriceConfigMapper.updateAppOrderPriceConfig(appOrderPriceConfig);
    }

    /**
     * 批量删除订单价格配置
     * 
     * @param ids 需要删除的订单价格配置主键
     * @return 结果
     */
    @Override
    public int deleteAppOrderPriceConfigByIds(Long[] ids)
    {
        return appOrderPriceConfigMapper.deleteAppOrderPriceConfigByIds(ids);
    }

    /**
     * 删除订单价格配置信息
     * 
     * @param id 订单价格配置主键
     * @return 结果
     */
    @Override
    public int deleteAppOrderPriceConfigById(Long id)
    {
        return appOrderPriceConfigMapper.deleteAppOrderPriceConfigById(id);
    }
}
